package com.tim.app.server.result;

import android.text.TextUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 相册
 */

public class AlbumResult extends ResponseResult implements Serializable {

    private Res res;

    public Res getRes() {
        return res;
    }

    public void setRes(Res res) {
        this.res = res;
    }

    public static class Res implements Serializable {

        private List<Data> arraylist;

        public List<Data> getArraylist() {
            return arraylist;
        }

        public void setArraylist(List<Data> arraylist) {
            this.arraylist = arraylist;
        }

        public static class Data {

            private int id;
            private String userId;
            private String image;
            private long createTime;
            private long updateTime;

            private List<String> imageList;

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getUserId() {
                return userId;
            }

            public void setUserId(String userId) {
                this.userId = userId;
            }

            public String getImage() {
                return image;
            }

            public void setImage(String image) {
                this.image = image;
            }

            public long getCreateTime() {
                return createTime;
            }

            public void setCreateTime(long createTime) {
                this.createTime = createTime;
            }

            public long getUpdateTime() {
                return updateTime;
            }

            public void setUpdateTime(long updateTime) {
                this.updateTime = updateTime;
            }

            public List<String> getImageUrl() {
                if(!TextUtils.isEmpty(getImage())){
                    if(getImage().contains("#")){
                        return Arrays.asList(getImage().split("#"));
                    }else{
                        List<String> list = new ArrayList<>();
                        list.add(getImage());
                        return list;
                    }
                }
                return null;
            }
        }
    }
}
